<!DOCTYPE html>
<html>
<head>
  <title>晒单</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0"/>
  <meta content="yes" name="apple-mobile-web-app-capable" />
  <meta content="black" name="apple-mobile-web-app-status-bar-style" />
  <meta content="telephone=no" name="format-detection" />
  <link href="{G_TEMPLATES_CSS}/wx/style.css" rel="stylesheet">
  <link href="{G_TEMPLATES_CSS}/wx/comm.css" rel="stylesheet">
  <script src="{G_TEMPLATES_JS}/wx/jquery-2.1.4.min.js"></script>
  <style>
   body{
    background-color:#F3F3F3;
  }
</style>
</head>
<body>
  <header class="header">
   <span class="name">晒单</span>
   <img src="{G_TEMPLATES_IMAGE}/wx/add-img.png" class="edit e-click">
 </header>

 <div class="shaidan-rule">
   <img src="{G_TEMPLATES_IMAGE}/wx/laba.png" class="rule-img">
   <span>晒单规则：<span style="color:#909090;font-size:12px;">只有参与揭晓并获得奖品的玩家才可晒单</span></span>
 </div>

 <div class="shaidan-list">
   <ul>
     {wc:loop $shaidan $shaidan}
     <input type="hidden" id="hidden" value="{wc:$count}"></input>
    
     <li>
       <img src="{G_UPLOAD_PATH}/{wc:$shaidan['sd_thumbs']}" class="shaidan-touimg">
       <a href="{WEB_PATH}/mobile/shaidan/detail/{wc:$shaidan['sd_id']}/{wc:$shaidan['sd_shopid']}">
       <span class="shaidan-username">{wc:fun:get_user_name($shaidan['sd_userid'])}</span></a>
       <span class="try">试试手气>></span>
       <div class="shaidan-content">{wc:$shaidan['sd_content']}</div>
       <!-- <span class="jx-date">揭晓日期：<?
        echo date("Y-m-d",$shaidan['sd_time'])
        ?></span> -->
        <a href="{WEB_PATH}/mobile/shaidan/detail/{wc:$shaidan['sd_id']}/{wc:$shaidan['sd_shopid']}">
          <ul class="goods-shaidan">
          <? $shaiimg=explode(';',$shaidan['sd_photolist'])
          ;
          for($i=0;$i < count($shaiimg)-1;$i++ ){
          echo '<li>'; 
          echo '<img src="'.G_UPLOAD_PATH.'/'.$shaiimg[$i].'">';
          echo '</li>';

          }
          ?>
           
         </ul>
       </a><br />
       <span class="shaidan-update"><?
        echo date("Y-m-d",$shaidan['sd_time'])
        ?>更新</span>
        <div class="zan">
          <img src="{G_TEMPLATES_IMAGE}/wx/zan_click.png" class="xin" state="0">
          <span class="zan-num">{wc:$shaidan['sd_zhan']}</span>
        </div>
      </li>
     {wc:loop:end}   

    </ul>
  </div>

  {wc:templates "mobile/index","footer"}

  <script>
   $(document).ready(function(e) {
    var count = $("#hidden").val();
    
    for (var i = 0; i < count; i++) {
     
      var sws= $(".shaidan-username").eq(i).text();
      var content= $(".shaidan-content").eq(i).text();
      var newcontent = content.substr(0,18)+"...";
      var str=sws.substr(0,12)+"...";
      $(".shaidan-content").eq(i).text(newcontent);
      $(".shaidan-username").eq(i).text(str);
    }
    
    $(".xin").click(function(){
     var sw=$(".xin").index(this);
     var sta=$(".xin").eq(sw).attr("state");
     var zNum=parseInt($(".zan-num").eq(sw).text());
     if(sta==0){
      $(".xin").eq(sw).attr("src","{G_TEMPLATES_IMAGE}/wx/zan_click.png");
      $(".xin").eq(sw).attr("state","1");
      zNum++;
      $(".zan-num").eq(sw).text(zNum);
    }else{
      $(".xin").eq(sw).attr("src","{G_TEMPLATES_IMAGE}/wx/zan.png");
      $(".xin").eq(sw).attr("state","0");
      zNum--;
      $(".zan-num").eq(sw).text(zNum);
    }
  })
  });
</script>
<script type="text/javascript">
  
</script>
</body>
</html>
